package com.kly.sc.api.application.controller.user;

import com.kly.sc.api.application.controller.user.request.WlmUserRequest;
import com.kly.sc.api.application.controller.user.response.UserLikeResponse;
import com.kly.sc.api.application.service.user.UserLikeService;
import com.kly.sc.api.application.service.utils.BaseComponent;
import com.kly.sc.api.application.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/api/user/like")
@Api(value = "/api/user/like", tags = "用户like")
public class UserLikeController extends BaseComponent {

    @Resource
    private UserLikeService userLikeService;

    @PostMapping("/list")
    @ApiOperation(value = "like列表", notes = "like列表")
    public Result<List<UserLikeResponse>> getUserLikeList(@RequestBody WlmUserRequest wlmUserRequest) {
        return userLikeService.getUserLikeList(wlmUserRequest, super.showTurnOns());
    }

    @GetMapping("/count")
    @ApiOperation(value = "like次数", notes = "like次数")
    public Result<Integer> getUserLikeCount() {
        return userLikeService.getUserLikeCount();
    }

}
